//
//  DownLoadListTVC.m
//  断点下载PDF
//
//  Created by 徐凯 on 16/5/13.
//  Copyright © 2016年 cqjtu. All rights reserved.
//

#import "DownLoadListTVC.h"
#import "PDFViewVC.h"

@implementation DownLoadListTVC

- (void)viewDidLoad{
   
    [super viewDidLoad];
    
}

- (void)didReceiveMemoryWarning{
    
    [super didReceiveMemoryWarning];
}

///判断btn是否二次点击
- (BOOL) isTheSameColor:(UIColor*)color1 anotherColor:(UIColor*)color2 {
    
    if (CGColorEqualToColor(color1.CGColor, color2.CGColor)) {
        return YES;
    }
    else {
        return NO;
    }
}

- (IBAction)btnAclick:(UIButton *)sender{
   
    UIColor* oldColor = _downLoadFinish.titleLabel.textColor;
    UIColor* newColor = [UIColor colorWithRed:1/255.0 green:204/255.0 blue:204/255.0 alpha:1.0];
    
    if (![self isTheSameColor:oldColor anotherColor:newColor]) {
        
        [_downLoadFinish setTitleColor:newColor forState:UIControlStateNormal];
        [_downLoading setTitleColor:oldColor forState:UIControlStateNormal];
        
    }
    PDFViewVC* vc = [[PDFViewVC alloc] init];
    vc.fileUrl = @"http://www.cninct.com/data/upload/wx_file/1601/22/56a1866aa2444.pdf";
    vc.fileName=@"";
    [self.navigationController pushViewController:vc animated:YES];
    
}

- (IBAction)downLoadingAction:(id)sender {
    
    UIColor* oldColor = _downLoadFinish.titleLabel.textColor;
    UIColor* newColor = [UIColor colorWithRed:1/255.0 green:204/255.0 blue:204/255.0 alpha:1.0];
    
    if (![self isTheSameColor:oldColor anotherColor:newColor]) {
        
        [_downLoading setTitleColor:newColor forState:UIControlStateNormal];
        [_downLoadFinish setTitleColor:oldColor forState:UIControlStateNormal];
        
    }
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
    return 0;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
    return 0;
}

/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
    
    // Configure the cell...
    
    return cell;
}
*/

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
